const state = {
  aa: 1
};

const mutations = {
  jia(state) {
    return state.aa += 1;
  },
  jia1(state, n) {
    return state.aa += n.a;
  },
  jian(state) {
    return state.aa -= 1;
  }
};

const actions = {
  jiaplus(context) {
    context.commit('jia1', {a: 2})
  }
};

const getters = {
  aa(state) {
    return state.aa += 10;
  }
};

export default {
  state,
  // 同步方法
  mutations,
  // 异步方法
  actions,
  getters,
}
